package com.qsign.sfrz_android.utils;

import android.os.CountDownTimer;
import android.widget.Button;

public class CountDownTimerUtilsFace extends CountDownTimer {
    private Button mTextView;

    public CountDownTimerUtilsFace(Button textView, long millisInFuture, long countDownInterval) {
        super(millisInFuture, countDownInterval);
        this.mTextView = textView;
    }

    @Override
    public void onTick(long millisUntilFinished) {
        mTextView.setClickable(false); //设置不可点击
        mTextView.setText("没收到，" + millisUntilFinished / 1000 + "秒后重新获取");  //设置倒计时时间
    }

    @Override
    public void onFinish() {
        mTextView.setText("重新获取验证码");
        mTextView.setClickable(true);//重新获得点击
        //mTextView.setBackgroundResource(R.drawable.getcode_normal);  //还原背景色
    }
}
